<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
?>

  <div class="container">
    <div class="row">
       <?php echo $this->render('_leftnav'); ?>
        <div class="col-md-10">
          <div class="page-header clearfix">
            <h1 class="pull-left">软件编辑</h1>
            <div class="pull-right">
            <a class="btn btn-success btn-sm" href="<?=Url::toRoute(['download/index']);?>">软件列表</a>
            </div>
          </div>

  <fieldset>
	<?php
	$form = ActiveForm::begin([
	'action' => ['download/updatesoft','id'=>$info['soft_id']],
	'method'=>'post',
	'options' => [
					'enctype' => 'multipart/form-data',
					'class'=>'form-horizontal'
				 ],
	'fieldConfig' => [
                       'template' => '<div class="form-group"><div class="col-md-2 control-label">{label}</div><div class="col-md-8 controls">{input}{error} </div></div>'
					 ], 
		]);	
	?>

	<?php echo $form->field($model, 'soft_name', ['inputOptions' => ['class' => 'form-control', 'placeholder' => '请入软件名','value' => $info['soft_name']]])->textInput(['maxlength' => 20]) ?>
	
	<?php $model->softcate_id = $info['softcate_id'] ?>
	<?php echo $form->field($model, 'softcate_id',['template'=>'<div class="form-group">
    <div class="col-md-2 control-label">{label}</div><div class="col-md-8 controls">  {input}</div></div>'])->dropDownList($softcat, ['prompt'=>' -- 请选择 -- ']) ?>	
    
	 <div class="form-group"  style='margin-right:40px'>
      <div class="col-md-2 control-label">
        <label for="name">相关课程</label>
      </div>
       <div class="controls col-md-8 checkbox">
	<?= Html::checkboxList('course_id',$softcourse, ArrayHelper::map($course, 'id', 'name')) ?>
	 </div>
    </div>   

	<?php echo $form->field($model, 'soft_sort', ['inputOptions' => ['class' => 'form-control', 'value' => $info['soft_sort']]])->textInput() ?>

	<?php echo $form->field($model, 'soft_points', ['inputOptions' => ['class' => 'form-control', 'placeholder' => '15 积分', 'value' => $info['soft_points']]])->textInput() ?>	

	<?php echo $form->field($model, 'soft_desc', ['inputOptions' => ['class' => 'form-control', 'placeholder' => '软件的简但描述', 'value' => $info['soft_desc']]])->textarea(['rows'=>5]) ?>

	<?php $model->soft_status = $info['soft_status'] ?>
	<?php echo $form->field($model, 'soft_status',['template'=>'<div class="form-group">
    <div class="col-md-2 control-label">{label}</div><div class="controls col-md-8 radios">  {input}</div></div>'])->radioList(['1'=>'允许','0'=>'不允许']) ?>	
    
	<!-- <?= $form->field($upmodel, 'imageFile',['template'=>'<div class="form-group">
	    <div class="col-md-2 control-label">{label}</div><div class="col-md-8 cont rols">  {input}</div></div>'])->fileInput() ?>  -->	   

     <div class="form-group">
      <div class="row form-group">
		 <div class="controls col-md-offset-2 col-md-8">     
	  <?= Html::submitButton('更新', ['class'=>'btn btn-primary']) ?>
		 </div>
      </div>    
	</div>
	</fieldset>
	  </div>
<?php ActiveForm::end(); ?>

